using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Tools;
using Pixysoft.Framework.Verifications;
using Pixysoft.Framework.Noebe;
using Pixysoft.Weblications.Sango.Entities;

namespace Pixysoft.Weblications.Sango.Environment
{

    public class SysVipSettingHelper
    {
        private static List<Sys_Vipsetting> orms = new List<Sys_Vipsetting>();

        public static void initialize()
        {
            orms = SettingHelper.GetNoebe().EntityNoebeCommand.Select<Sys_Vipsetting>();

            LoggerHelper.Info("initialize Sys_Vipsetting.count {0}", orms.Count);
        }

        public static Sys_Vipsetting search(long level)
        {
            foreach (Sys_Vipsetting orm in orms)
            {
                if (orm.Viplevel == level)
                    return orm;
            }

            throw Exceptions.VerificationFailedException(level);
        }

        public static List<Sys_Vipsetting> searchAll()
        {
            return orms;
        }
    }
}